package com.zzyl.controller;

import com.zzyl.base.ResponseResult;
import com.zzyl.service.ResourceService;
import com.zzyl.utils.UserThreadLocal;
import com.zzyl.vo.MenuVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@Api(tags = "菜单管理接口")
public class MenusController {
 @Autowired
 private ResourceService resourceService;
/**
 * @author     ：zhangheng
 * @date       ：Created in 2024/9/10 9:43
 * @description：菜单管理
 * @modified By：
 * @version: 1.0
 */
//@GetMapping("/resource/menus")
@ApiOperation("动态菜单权限")
public ResponseResult<List<MenuVo>> menus() {
 Long mgtUserId = UserThreadLocal.getMgtUserId();
 List<MenuVo> menuVoList = resourceService.menus(mgtUserId);
 return ResponseResult.success(menuVoList);
}
}

